<!DOCTYPE html>
<html>
<head>
    <title>erp订单信息表</title>
    <#include "/header.html">
</head>
<body>
<div id="quoteAddPage">
    <!-- 必选部件 start -->
    <div v-for="(quotePart,key1) in quotePartsList"  v-if="quotePart.mustChoice" style="margin-bottom: 10px;">
        <!-- 必选工艺 start -->
        <el-row>
            <span>{{quotePart.name}}</span>
            <hr style="margin-top: 5px;margin-bottom: 5px;"/>
        </el-row>
        <el-row style="font-size: 12px;padding-left: 15px;">
            <div v-for="(quoteAttribute,key2) in quotePart.quoteAttributeList"
                 style="line-height: 35px;">
                <span v-if="quoteAttribute.attributeType == 'craft' && quoteAttribute.mustChioce!= true" hidden>{{craftWheter[quotePart.constructId]=true}}</span>
                <div  v-if="(quoteAttribute.attributeType != 'craft')||(quoteAttribute.attributeType == 'craft' && quoteAttribute.mustChioce == true)">
                    <!-- 必选显示工艺 start -->
                    <div v-if="quoteAttribute.quoteAttributeOptionList.length > 1">
                        <div style="float: left;padding-left: 10px;">
                            <label>{{quoteAttribute.name}}</label>:&nbsp;&nbsp;
                        </div>
                        <!-- 非材料属性 start -->
                        <div style="float: left;" v-if="quoteAttribute.attributeType != 'material'">
                            <div style="float: left;" >
                                <el-select  placeholder="请选择"
                                            style="width: 150px"
                                            size="mini"
                                            @change="quoteAttributeChange(quotePart.constructId,quoteAttribute)"
                                            v-model="caculateQuoteData.attributesMap[quotePart.constructId][quoteAttribute.attributeTypeValue]">
                                    <el-option  v-for="item in quoteAttribute.quoteAttributeOptionList"
                                                :key="item.id"
                                                :label="item.name"
                                                :value="item.id">
                                    </el-option>
                                </el-select>&nbsp;&nbsp;
                                <span hidden v-if="quoteAttribute.quoteAttributeOptionList.length == 1">
                            </span>
                            </div>
                            <!-- 是否自定义 -->
                            <div style="float: left;" v-if="quoteAttribute.canDefinition">
                                <el-checkbox v-model="defineWheter[quotePart.constructId][quoteAttribute.attributeTypeValue]"
                                             @change="defineChange(quotePart.constructId,quoteAttribute)">
                                    <span style="font-size: 10px">自定义2</span>
                                </el-checkbox>
                            </div>
                            <!-- 自定义值 -->
                            <div v-if="quoteAttribute.canDefinition && defineWheter[quotePart.constructId][quoteAttribute.attributeTypeValue]"
                                 v-for="(defintion,index) in defineArray[quotePart.constructId][quoteAttribute.attributeTypeValue]"
                                 style="float: left;">
                                <!--<div v-if="index == 0">-->
                                <el-input v-model="caculateQuoteData.definitionValueMap[quotePart.constructId][quoteAttribute.attributeTypeValue][index]"
                                          size="mini"
                                          :placeholder=defintion
                                          @change="checkNum(defintion,quotePart.constructId,quoteAttribute.attributeTypeValue,index)"
                                          type="number"
                                          style="width: 80px">
                                </el-input>
                                <!--</div>-->
                            </div>
                        </div>
                        <!-- 非材料属性 end -->
                        <!-- 材料属性 start -->
                        <div style="width: 260px;float: left;" v-if="quoteAttribute.attributeType == 'material'">
                            <div style="width: 100px;float: left;">
                                <el-select  placeholder="材料" size="mini" v-model="material[quotePart.constructId]" @change="materialChange(quotePart.constructId)">
                                    <el-option  v-for="item in quoteAttribute.quoteAttributeOptionList" :label="item.name" :value="item.sonOptionList"></el-option>
                                </el-select>
                            </div>
                            <div style="width: 69px;float: left;">
                                <el-select  placeholder="克重" size="mini" v-model="caculateQuoteData.attributesMap[quotePart.constructId][quoteAttribute.attributeTypeValue]">
                                    <el-option  v-for="item in material[quotePart.constructId]" :key="item.id" :label="item.name" :value="item.id"></el-option>
                                </el-select>
                            </div>
                            <div style="float: left;">&nbsp;
                                <el-checkbox v-model="caculateQuoteData.selfPaperParts[quotePart.constructId]" style="font-size: 12px">
                                    <span style="font-size: 10px">自来纸</span>
                                </el-checkbox>
                            </div>
                        </div>
                        <!-- 材料属性 end -->
                    </div>
                    <!-- 必选显示工艺 end -->
                    <!-- 必选不显示工艺 start -->
                    <div v-if="quoteAttribute.quoteAttributeOptionList.length == 1">
                        <span hidden>{{caculateQuoteData.attributesMap[quotePart.constructId][quoteAttribute.attributeTypeValue] = quoteAttribute.quoteAttributeOptionList[0].id}}</span>
                    </div>
                    <!-- 必选不显示工艺 end -->
                </div>
            </div>
        </el-row>
        <!-- 必选工艺 end -->
        <!-- 非必选工艺 start -->
        <div v-show="craftWheter[quotePart.constructId]">
            <el-row>
                <el-checkbox v-model="addCraft[quotePart.constructId]">添加工艺</el-checkbox>
                <hr style="margin-top: 5px;margin-bottom: 5px;"/>
            </el-row>
            <el-row v-show="addCraft[quotePart.constructId]">
                <span>{{quotePart.name}}:&nbsp;&nbsp;</span>
                <div v-for="(quoteAttribute,key2) in quotePart.quoteAttributeList" v-if="quoteAttribute.attributeType == 'craft'" style="line-height: 35px;">
                    <div style="float: left;padding-left: 10px;">
                        <label>{{quoteAttribute.name}}</label>:&nbsp;&nbsp;
                    </div>
                    <!-- 工艺属性 start -->
                    <div style="float: left;">
                        <el-select  placeholder="请选择" style="width: 150px" size="mini" v-model="caculateQuoteData.attributesMap[quotePart.constructId][quoteAttribute.attributeTypeValue]">
                            <el-option  v-for="item in quoteAttribute.quoteAttributeOptionList" :key="item.id" :label="item.name" :value="item.id"></el-option>
                        </el-select>&nbsp;&nbsp;
                    </div>
                    <!-- 是否自定义 -->
                    <div style="float: left;" v-if="quoteAttribute.canDefinition">
                        <el-checkbox v-model="defineWheter[quotePart.constructId][quoteAttribute.attributeTypeValue]"
                                     @change="defineChange(quotePart.constructId,quoteAttribute)">
                            <span style="font-size: 10px">自定义</span>
                        </el-checkbox>
                    </div>
                    <!-- 自定义值 -->
                    <div style="float: left;" v-if="quoteAttribute.canDefinition && defineWheter[quotePart.constructId][quoteAttribute.attributeTypeValue]"
                         v-for="(defintion,index) in defineArray[quotePart.constructId][quoteAttribute.attributeTypeValue]">
                        <el-input v-model="caculateQuoteData.definitionValueMap[quotePart.constructId][quoteAttribute.attributeTypeValue][index]" size="mini" style="width: 50px"></el-input>
                    </div>
                    <!-- 工艺属性 end -->
                </div>
            </el-row>
        </div>
        <!-- 非必选工艺 end -->
    </div>
    <!-- 必选部件 end -->
    <!-- 非必选部件 start -->
    <div v-for="(quotePart,key1) in quotePartsList"  v-if="!quotePart.mustChoice" style="margin-bottom: 10px;">
        <el-row>
            <el-button @click="mustChoiceClick(quotePart.constructId)" type="text" size="medium">{{quotePart.name}}</el-button>
            <hr style="margin-top: 5px;margin-bottom: 5px;"/>
        </el-row>
        <el-row v-show="quotePartShow[quotePart.constructId]" style="font-size: 12px;padding-left: 15px;">
            <!-- 必选工艺 start -->
            <el-row style="font-size: 12px;padding-left: 15px;">
                <div v-for="(quoteAttribute,key2) in quotePart.quoteAttributeList"
                     style="line-height: 35px;">
                    <span v-if="quoteAttribute.attributeType == 'craft' && quoteAttribute.mustChioce!= true" hidden>{{craftWheter[quotePart.constructId]=true}}</span>
                    <div  v-if="(quoteAttribute.attributeType != 'craft')||(quoteAttribute.attributeType == 'craft' && quoteAttribute.mustChioce == true)">
                        <div style="float: left;padding-left: 10px;">
                            <label>{{quoteAttribute.name}}</label>:&nbsp;&nbsp;
                        </div>
                        <!-- 非材料属性 start -->
                        <div style="float: left;" v-if="quoteAttribute.attributeType != 'material'">
                            <div style="float: left;">
                                <el-select  placeholder="请选择"
                                            style="width: 150px"
                                            size="mini"
                                            @change="quoteAttributeChange(quotePart.constructId,quoteAttribute)"
                                            v-model="caculateQuoteData.attributesMap[quotePart.constructId][quoteAttribute.attributeTypeValue]">
                                    <el-option  v-for="item in quoteAttribute.quoteAttributeOptionList" :key="item.id" :label="item.name" :value="item.id"></el-option>
                                </el-select>&nbsp;&nbsp;
                            </div>
                            <!-- 是否自定义 -->
                            <div style="float: left;" v-if="quoteAttribute.canDefinition">
                                <el-checkbox v-model="defineWheter[quotePart.constructId][quoteAttribute.attributeTypeValue]"
                                             @change="defineChange(quotePart.constructId,quoteAttribute)">
                                    <span style="font-size: 10px">自定义</span>
                                </el-checkbox>
                            </div>
                            <!-- 自定义值 -->
                            <div style="float: left;" v-if="quoteAttribute.canDefinition && defineWheter[quotePart.constructId][quoteAttribute.attributeTypeValue]"
                                 v-for="(defintion,index) in defineArray[quotePart.constructId][quoteAttribute.attributeTypeValue]">
                                <el-input v-model="caculateQuoteData.definitionValueMap[quotePart.constructId][quoteAttribute.attributeTypeValue][index]" size="mini" style="width: 50px"></el-input>
                            </div>
                        </div>
                        <!-- 非材料属性 end -->
                        <!-- 材料属性 start -->
                        <div style="width: 260px;float: left;" v-if="quoteAttribute.attributeType == 'material'">
                            <div style="width: 100px;float: left;">
                                <el-select  placeholder="材料" size="mini" v-model="material[quotePart.constructId]" @change="materialChange(quotePart.constructId)">
                                    <el-option  v-for="item in quoteAttribute.quoteAttributeOptionList" :label="item.name" :value="item.sonOptionList"></el-option>
                                </el-select>
                            </div>
                            <div style="width: 69px;float: left;">
                                <el-select  placeholder="克重" size="mini" v-model="caculateQuoteData.attributesMap[quotePart.constructId][quoteAttribute.attributeTypeValue]">
                                    <el-option  v-for="item in material[quotePart.constructId]" :key="item.id" :label="item.name" :value="item.id"></el-option>
                                </el-select>
                            </div>
                            <div style="float: left;">&nbsp;
                                <el-checkbox v-model="caculateQuoteData.selfPaperParts[quotePart.constructId]" style="font-size: 12px">
                                    <span style="font-size: 10px">自来纸</span>
                                </el-checkbox>
                            </div>
                        </div>
                        <!-- 材料属性 end -->
                    </div>
                </div>
            </el-row>
            <!-- 必选工艺 end -->
            <!-- 非必选工艺 start -->
            <div v-show="craftWheter[quotePart.constructId]">
                <el-row>
                    <el-checkbox v-model="addCraft[quotePart.constructId]">添加工艺</el-checkbox>
                    <hr style="margin-top: 5px;margin-bottom: 5px;"/>
                </el-row>
                <el-row v-show="addCraft[quotePart.constructId]">
                    <div v-for="(quoteAttribute,key2) in quotePart.quoteAttributeList" v-if="quoteAttribute.attributeType == 'craft'" style="line-height: 35px;">
                        <div style="float: left;padding-left: 10px;">
                            <label>{{quoteAttribute.name}}</label>:&nbsp;&nbsp;
                        </div>
                        <!-- 工艺属性 start -->
                        <div style="float: left;">
                            <el-select  placeholder="请选择"
                                        style="width: 150px"
                                        size="mini"
                                        @change="quoteAttributeChange(quotePart.constructId,quoteAttribute)"
                                        v-model="caculateQuoteData.attributesMap[quotePart.constructId][quoteAttribute.attributeTypeValue]">
                                <el-option  v-for="item in quoteAttribute.quoteAttributeOptionList" :key="item.id" :label="item.name" :value="item.id"></el-option>
                            </el-select>&nbsp;&nbsp;
                        </div>
                        <!-- 是否自定义 -->
                        <div style="float: left;" v-if="quoteAttribute.canDefinition">
                            <el-checkbox v-model="defineWheter[quotePart.constructId][quoteAttribute.attributeTypeValue]"
                                         @change="defineChange(quotePart.constructId,quoteAttribute)">
                                <span style="font-size: 10px">自定义</span>
                            </el-checkbox>
                        </div>
                        <!-- 自定义值 -->
                        <div style="float: left;" v-if="quoteAttribute.canDefinition && defineWheter[quotePart.constructId][quoteAttribute.attributeTypeValue]"
                             v-for="(defintion,index) in defineArray[quotePart.constructId][quoteAttribute.attributeTypeValue]">
                            <el-input v-model="caculateQuoteData.definitionValueMap[quotePart.constructId][quoteAttribute.attributeTypeValue][index]" size="mini" style="width: 50px"></el-input>
                        </div>
                        <!-- 工艺属性 end -->
                    </div>
                </el-row>
            </div>
            <!-- 非必选工艺 end -->
        </el-row>
    </div>
    <!-- 非必选部件 end -->
    <el-button type="primary" @click="caculateQuote" size="small">算价</el-button>
</div>
<script src="${request.contextPath}/statics/js/modules/order/quoteAdd.js?_${.now?long}"></script>
</body>
</html>